//
//  LoadingView.m
//  Mdongying
//
//  Created by mac pro -chenweishuai on 14-3-19.
//  Copyright (c) 2014年 伟帅陈. All rights reserved.
//

#import "LoadingView.h"
#import "OLImageView.h"
#import "OLImage.h"


@implementation LoadingView

- (id)initWithSuperView:(UIView *)superView
{
    self = [super init];
    if (self) {
        // Initialization code
        self.frame = CGRectMake(0, 0, superView.frame.size.width, superView.frame.size.height);
        self.backgroundColor = [UIColor whiteColor];
        self.userInteractionEnabled = NO;
        
        UIImageView * myImageView = [[UIImageView alloc]init];
        [myImageView setFrame:CGRectMake(0,0,superView.frame.size.width,superView.frame.size.height)];
//        [myImageView setImage:[AppUtility getLocalImage:@"back_apla_loading"]];
        myImageView.backgroundColor = [UIColor clearColor];
        [self addSubview:myImageView];
        
        UIImageView * iconImageView = [[UIImageView alloc]init];
        [iconImageView setFrame:CGRectMake((superView.frame.size.width-100.0f)/2,(superView.frame.size.height-100.0f)/2-20,100.0f,100.0f)];
        iconImageView.backgroundColor = [UIColor clearColor];
        [myImageView addSubview:iconImageView];
        
        OLImageView *Aimv = [OLImageView new];
        NSString *filePath = [[NSBundle mainBundle] pathForResource:@"loading" ofType:@"gif"];
        NSData *GIFDATA = [NSData dataWithContentsOfFile:filePath];
        Aimv.image = [OLImage imageWithData:GIFDATA];
        [Aimv setFrame:CGRectMake(18,18,64,64)];
        [iconImageView addSubview:Aimv];
        
        [superView addSubview:self];
        
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
